package com.atjinggu.jinggumail.product.web;

import com.atjinggu.jinggumail.product.service.SkuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.concurrent.ExecutionException;

/**
 * @author jingming
 * @Type itemController.java
 * @Desc
 * @date 2021/2/20 17:36
 */
@Controller
public class itemController {

    @Autowired
    SkuInfoService skuInfoService;

    @GetMapping("/{skuId}.html")
    public String item(@PathVariable("skuId") String skuId, Model model) throws ExecutionException, InterruptedException {
         model.addAttribute("item",skuInfoService.item(skuId));
        return "item";
    }
}